$(function() {
    let id = location.href.split('?')[1]
    axios({
        method: 'GET',
        url: '/my/article/' + id
    }).then(({ data: res }) => {
        // console.log(res);
        if (res.status != 0) {
            return layui.layer.msg(res.message)
        }
        layui.layer.msg(res.message)
        $('.box').empty().html(`
                  <div class="artinfo-box">
                  <h1 class="artinfo-title">${res.data.title}</h1>
                  <div class="artinfo-bar">
                      <span>作者ID：${res.data.author_id}</span>
                      <span>发布时间：${res.data.pub_date}</span>
                      <span>所属分类ID：${res.data.cate_id}</span>
                      <span>状态：${res.data.state}</span>
                  </div>
                  <hr>
                  <img src="http://api-breakingnews-web.itheima.net${res.data.cover_img}" alt="" class="artinfo-cover">
                  <div>
                      ${res.data.content}
                  </div>
    </div>
        `)
    })
})